package gui;

import java.awt.Dimension;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;



import net.miginfocom.layout.CC;
import net.miginfocom.swing.MigLayout;

public class Template extends JSplitPane {
    private static Template instance = null;
  
    public static Template getInstance() {
        if(instance == null) {
            instance = new Template();
        } 
        return instance;
    }
    
JPanel panel = new JPanel();

JScrollPane span = new JScrollPane(DataPage.getInstance());

	
	private Template() {
		System.out.println("Tworze template");
 
//Panel Opisu -> Ocena,Marka,Model ...
		panel.setLayout(new MigLayout());
        JPanel desc = new JPanel();
        desc.setLayout(new MigLayout());
         span.setMinimumSize(new Dimension(590,445));
        desc.setMinimumSize(new Dimension(595,30));
        desc.setBorder(BorderFactory.createRaisedBevelBorder());
        final JLabel oL = new JLabel("    Ocena");
        oL.setFont(new Font("Tahoma", Font.BOLD, 11));
        final JLabel mrL = new JLabel("       Marka");
        mrL.setMinimumSize(new Dimension(100,15));
        mrL.setFont(new Font("Tahoma", Font.BOLD, 11));
        final JLabel mL = new JLabel("    Model");
        mL.setMinimumSize(new Dimension(75,15));
        mL.setFont(new Font("Tahoma", Font.BOLD, 11));
        final JLabel rpL = new JLabel("     Rok produkcji");
        rpL.setMinimumSize(new Dimension(115,15));
        rpL.setFont(new Font("Tahoma", Font.BOLD, 11));
        final JLabel cL = new JLabel("   Cena");
        cL.setFont(new Font("Tahoma", Font.BOLD, 11));
        desc.add(oL);
        desc.add(mrL);
        desc.add(mL);
        desc.add(rpL);
        desc.add(cL);
        panel.add(desc,"wrap");
        panel.add(span);
//---- 
		span.setHorizontalScrollBarPolicy(span.HORIZONTAL_SCROLLBAR_NEVER);
		setDividerLocation(270);
		setLeftComponent(MenuLeft.getInstance());
	    setRightComponent(panel);
	    
	    
		
	}
	
	

	
	
	   

}
